/*
 * @Author: 朱自强
 * @Date: 2024-03-08 08:53:11
 * @LastEditors: 朱自强
 * @LastEditTime: 2024-03-13 13:48:58
 * @FilePath: \A-LOT-OF-TEST-VUE3\src\main.ts
 * @Description:
 *
 * Copyright (c) 2024 by 朱自强, All Rights Reserved.
 */
import './assets/main.css'
import './style/common.css'
import './style/global.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

// 引入aggrid
import AgGridVue from '@/plugins/setupAgGrid'
// 引入naiveUI
import Naive from '@/plugins/setupNaive'
// 引入静态json文件
import readConfigJson from '@/plugins/setupConfigJson'
// 引入 Splitpanes
import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes'

// 创建app
const app = createApp(App)
// 挂载pinia
app.use(createPinia())
// 挂载路由
app.use(router)
// 挂载naiveUI
app.use(Naive)
// 挂载aggrid
app.component('ag-grid-vue', AgGridVue)
// 挂在splitpanes
app.component('split-pane', Splitpanes)
app.component('paneSpan', Pane)

// 读取静态json文件
readConfigJson().then((res) => {
  console.log(`读取静态json文件结果`, res)
  // 挂载到全局参数上
  app.config.globalProperties._config = res
  // 挂载app
  app.mount('#app')
})
